<?php
require_once ("./script/application.php");
$selected_file = $_GET['file'];
$xml = new xml("./script/user.xml");
$xml->load_file();

$users = application::get_file_users($xml);
$permissions;

?>
<br>
<div class="left_box">
	
</div>

<div id="admin_header">
	<div class="admin_index_title">Gestion des droits <?php echo '('.realpath('./files/'.$selected_file).')'; ?> </div>
</div>

<div id="admin_header_border"></div>
	
	<div id="admin_header">
		<div class="admin_users_title"> Utlisateurs </div >
	</div>

	<div id="admin_header_border"></div>

<div class="table_grid">
		<table cellspacing="0" cellpadding="0">
			<?php
				if(isset($users) && count($users) > 0)
				{
					foreach($users as $ligne)
					{
						echo '<tr class="even">';
							echo '<td style="width:10px;"><input type="radio" name="_checkbox" id="selectCheckbox" value="'.$ligne['login'].'" /></td>';
							echo '<td style ="text-align:left;width:20px;"><img src="./images/adminicons/users.png" width="20"/></td>';
							echo '<td style ="text-align:left;width:30px">'.$ligne['login'].'</td>';
							echo '<td style ="text-align:left;">'.$ligne['firstName'].' '.$ligne['lastName'].'</td>';
						echo '</tr>';
					}
				}
			?>
			
						
		</table>
</div>

<div id="admin_header">
	<div class="admin_permissions_title" id="perm_title"> Autorisations </div> 
</div>

<div id="admin_header_border"></div>

<div class="table_grid" id="t_permissions">
	<table id ="tbl_droits">
		<tr class='even'>
			<td style='width:20px;'><input type="checkbox" id="updatechbx" value="update"/></td>
			<td style ="text-align:left;width:20px;"><img src="./images/adminicons/per.png" width="20"/></td>
			<td style='width:auto;text-align:left;' value="update">Modification</td>
		</tr>
		<tr class='even'>
			<td style='width:20px;'><input type="checkbox" id="readchbx" value="read"/></td>
			<td style ="text-align:left;width:20px;"><img src="./images/adminicons/per.png" width="20"/></td>
			<td style='width:auto;text-align:left;' value="read">Lecture</td>
		</tr>
		<tr class='even'>
			<td style='width:20px;'><input type="checkbox" id="writechbx" value="write"/></td>
			<td style ="text-align:left;width:20px;"><img src="./images/adminicons/per.png" width="20"/></td>
			<td style='width:auto;text-align:left;' value="write">Ecriture</td>
		</tr>
		<tr class='even'>
			<td style='width:20px;'><input type="checkbox" id="deletechbx" value="delete"/></td>
			<td style ="text-align:left;width:20px;"><img src="./images/adminicons/per.png" width="20"/></td>
			<td style='width:auto;text-align:left;' value="delete">Suppression</td>
		</tr>
	</table>
	<script type="text/javascript" src="js/modify_permissions.js"></script>
</div>